

var mongoose = require("mongoose")

const hostname = "localhost"
const port = 27017
const dbname = "wh2008"

const db_conn_str = `mongodb://${hostname}:${port}/${dbname}`

mongoose.connect(db_conn_str,{
    useNewUrlParser: true,
    useUnifiedTopology: true
},function(err){
    if(err){
        console.log(err)
        console.log("数据库链接失败")
    }else{
        console.log("数据库链接成功")
    }
})
